<!--
 * @description  :情报管理首页
 * @descriptionDetail:情报管理首页
 * @copyright    : 浙江烟草
 * @author       : dw
 * @create       : 2022-11-19 14:37:47
-->
<template>
  <view class="page">
    <!-- #ifdef H5-ONLY -->
    <theme-navbar
      :is-white="false"
      :title="navTitle"
      :custom-back="goBack"
      style="z-index: 99999"
    >
    </theme-navbar>
    <!-- #endif -->
    <view class="content u-page">
      <!-- 内容区 -->
      <u-image class="head-img" :width="getImgWidth()" src="/static/intelligence/banner.png" mode="widthFix"></u-image>
      <view class="grid-lay">
        <u-grid :col="3" :border="false">
          <u-grid-item :index="index" v-for="(item,index) in list" :key="item.key" @click="gridClick">
            <u-image :src="item.iconPath" :width="120" mode="aspectFit" :height="120"></u-image>
            <view class="grid-text">
              {{ item.text }}
            </view>
          </u-grid-item>
        </u-grid>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  components: {

  },
  data() {
    return {
      list:[
        {
          iconPath: "../../static/intelligence/icon1.png",
          text: '窝点档案',
          key:0,
          url:'pages/intelligence/hideoutList',
        },
        {
          iconPath: "../../static/intelligence/icon2.png",
          text: '运输档案',
          key:1,
          url:'pages/intelligence/intelligenceTransportList',
        },
        {
          iconPath: "../../static/intelligence/icon3.png",
          text: '涉烟人档案',
          key:2,
          url:'pages/intelligence/personInvolvedList',
        },
        {
          iconPath: "../../static/intelligence/icon4.png",
          text: '情报登记派发',
          key:3,
          url:'pages/intelligence/intelligenceList?fromType=register',
        },
        {
          iconPath: "../../static/intelligence/icon5.png",
          text: '情报处置反馈',
          key:4,
          url:'pages/intelligence/intelligenceList?fromType=feedback',
        },
        {
          iconPath: "../../static/intelligence/icon1.png",
          text: '案件地图分布',
          key:5,
          url:'pages/intelligence/disMap',
        },
      ],
    };
  },
  // 页面加载成功后也要设置一次，用于处理本页面刷新后失效问题
  mounted() {

  },
  methods: {
    gridClick(index){
      console.log(index)
      if(this.list[index].url){
        this.setRouteParam(this.list[index].text);
        this.$u.route(this.list[index].url);
      }
    },
    getImgWidth(){
      return (this.$u.sys().windowWidth - uni.upx2px(32)) + 'px';
    },
  },
};
</script>

<style lang="scss" scoped>
.head-img{
  width: 100%;
  padding: 16rpx 16rpx;
  margin: 0 auto;
}
.grid-lay{
	padding: 0 32rpx;
}
.grid-text{
	color: $u-main-color;
	margin-top: 24rpx;
	font-size: 30rpx;
}
</style>
